package com.xiyuan.mapper;


import com.xiyuan.pojo.entity.MemoCategory;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface MemoCategoryMapper {

    /**
     * 添加分类
     * @param memoCategory
     * @return
     */
    int insert(MemoCategory memoCategory);

    /**
     * 获取分类列表
     * @param userId
     * @return
     */
    List<MemoCategory> getList(Integer userId);

    /**
     * 更新分类
     * @param memoCategory
     */
    void update(MemoCategory memoCategory);

    /**
     * 根据id获取分类
     * @param id
     * @return
     */
    @Select("select * from memo_categories where id = #{id}")
    MemoCategory findById(Integer id);

    /**
     * 根据id删除分类
     * @param id
     */
    void deleteById(Integer id);
}
